import store from '@/store'
export default {
    inserted(el, binding, vnode) {
      const { value } = binding
      const pageRule = store.getters.pageRule
      // 参数是否正确
      if (value && value instanceof Array && value.length > 0) {
        if (!pageRule.includes(value[0])) {
          el.parentNode && el.parentNode.removeChild(el)
        }
      } else {
        throw new Error(`need roles! Like v-permission="['admin']"`)
      }
    }
  }